﻿using PLCS.App.Shared.Extensions;
using PLCS.App.Shared.Views.Common;

namespace PLCS.App.Views;

/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
    private readonly IEventAggregator aggregator;

    public MainWindow(IEventAggregator aggregator)
    {
        InitializeComponent();
        this.Height = SystemParameters.WorkArea.Height;
        this.Width = SystemParameters.WorkArea.Width;
        this.aggregator = aggregator;
        //注册等待消息窗口
        aggregator.Resgiter(arg =>
        {
            DialogHost.IsOpen = arg.IsOpen;

            if (DialogHost.IsOpen)
                DialogHost.DialogContent = new ProgressView();
        });
    }

    //private void Button_Click(object sender, RoutedEventArgs e)
    //{
    //    if (this.WindowState == WindowState.Maximized)
    //        this.WindowState = WindowState.Normal;
    //    else
    //        this.WindowState = WindowState.Maximized;
    //}
}